<?php
/**
 * User: @fs
 * Date: 2017-9-16
 * Time: 17:37
 */

namespace core\lib\drive\log;

use core\lib\conf;

class file{

    public $path;


    public function __construct()
    {
        $this->path=conf::get('OPTION','log')['path'];
        $this->path.="/".date('Ymd');

    }

    public function log($message,$file){
        if(!is_dir($this->path)){
            mkdir($this->path,0777);
        }
        $file_path = $this->path."/".$file.".log";
        file_put_contents($file_path,$message." ".date("Y-m-d H:i:s").PHP_EOL,FILE_APPEND);
    }
}